PATHMac OS 8 Developer Documentation > Operating System Services > Multiprocessing Services >

Adding Multitasking Capability to Applications Using Multiprocessing Services

   

Allocating Memory in Tasks

If you need to allocate a block of memory for a task, you must call the function MPAllocateAligned . Doing so returns a pointer to allocated memory with the alignment you specify. You should always use the Multiprocessing Services memory allocation functions if your task needs to allocate, deallocate, or otherwise manipulate memory. For example, if your task deallocates its task data structure after it has finished processing, it must call MPFree . Note however, that since the memory is being deallocated by a preemptive task, you must have initially allocated the task record by calling MPAllocateAligned , even if this allocation didn't occur in a preemptive task.


© 1999 Apple Computer, Inc. – (Last Updated 07 May 99)